import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/Layout'
import Play from '@/views/Play'
import Home from '@/views/Home'
import Search from '@/views/Search'
Vue.use(VueRouter)
const router = new VueRouter({
  routes:[
    { path:'/',redirect:'/layout',},
    { 
      path:'/layout',component:Layout,
      children:[
        {path:'',redirect:'home'},
        {   
            name:'home',
            path:'home',
            component:Home,
            meta:{
                title:'首页'
            }
        },
        {   
            name:'search',
            path:'search',
            component:Search,
            meta:{
                title:'搜索'
            }
        }
      ]
    },
    { 
      name:'play',
      path:'/play/:id',
      component:Play
    },
  ]
})
export default router